#ifndef XGE_XSIMPLE_UNITTEST_REG_INL_H_
#define XGE_XSIMPLE_UNITTEST_REG_INL_H_


// Get the unique unit test register class name

#define UNIT_TEST_REGISTER_NAME_(test_family,test_case_name)  test_family ## test_case_name ## _TEST_REG

// Internal middle wrapper for obtaining the UNIT_TEST_OBJECT

#define UNIT_TEST_REGISTER_VERSION_1(test_family,test_case_name,parent_class,stub_class) \
class UNIT_TEST_REGISTER_NAME_(test_family,test_case_name) : public parent_class { \
public: \
  UNIT_TEST_REGISTER_NAME_(test_family,test_case_name) () { \
  object_ = new UNIT_TEST_NAME_(test_family,test_case_name) (); \
  xge::xge_internal::UnitTest::RegisterUnitTestCase( object_ , _xT(#test_family) , _xT(#test_case_name) ); \
  } \
  ~UNIT_TEST_REGISTER_NAME_(test_family,test_case_name) () { \
  delete object_; \
  } \
private: \
  stub_class* object_ ; \
  static UNIT_TEST_REGISTER_NAME_(test_family,test_case_name) kSelf; \
}; \
  UNIT_TEST_REGISTER_NAME_(test_family,test_case_name) UNIT_TEST_REGISTER_NAME_(test_family,test_case_name)::kSelf;


// Register the unit test class into the UT internal object

#define UNIT_TEST_MAKE_REGISTER_CLASS(test_family,test_case_name) \
  UNIT_TEST_REGISTER_VERSION_1(test_family,test_case_name,xge::xge_internal::UTRegisterBase,xge::xge_internal::UTBase)





#endif// XGE_XSIMPLE_UNITTEST_REG_INL_H_